package com.itheima.reggie.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.reggie.common.QueryPageDTO;
import com.itheima.reggie.common.Result;
import com.itheima.reggie.entity.Category;
import com.itheima.reggie.mapper.CategoryMapper;

import java.util.List;

/**
 * @author Yan
 * @date 2022/2/25
 */
public interface CategoryService extends IService<Category>{

    /**
     * 新增分类
     * @param category
     * @return
     */
    Result<String> saveCategory(Category category);

    /**
     * 分页查询
     * @param queryPageDTO
     * @return
     */
    Result<Page<Category>> findByPage(QueryPageDTO queryPageDTO);

    /**
     * 删除分类
     * @param id
     * @return
     */
    Result<String> deleteCategory(Long id);

    /**
     * 需要分类
     * @param category
     * @return
     */
    Result<String> updateCategory(Category category);

    /**
     * 菜品分类查询
     * @param type
     * @return
     */
    Result<List<Category>> listCategory(Integer type);
}
